#include <CL/sycl.hpp>

class kernel;

int main(){
  /* initiate arrays */
  constexpr dataSize;
  int a[dataSize], b[dataSize], r[dataSize];

  try{
    auto myQueue = sycl::queue{};

    auto bufA = sycl::buffer{a, sycl::range{dataSize}};
    ...bufB, bufR

    myQueue.submit([&](sycl::handler& cgh){
      sycl::accessor accA{bufA, cgh, sycl::read_only};
      ...accB, accR

      cgh.parallel_for<kernel>(
        sycl::range{dataSize},
        [=](sycl::id<1> idx){
          accR[idx] = accA[idx] + accB[idx];
        }
      );

    });

  } catch(const sycl::exception& e){
    std::cout<<e.what()<<std::endl;
  }

  return 0;
}